{
 "metadata": {
  "name": "",
  "signature": "sha256:e0a0544da301d3cef555b59b37f80ea80cc81d4304b196b99f0dcbb00f31f585"
 },
 "nbformat": 3,
 "nbformat_minor": 0,
 "worksheets": [
  {
   "cells": [
    {
     "cell_type": "heading",
     "level": 1,
     "metadata": {},
     "source": [
      "Manual liftover of NM_001261456.1:c.1762A>G (rs509749) to NM_001261457.1 via GRCh37"
     ]
    },
    {
     "cell_type": "raw",
     "metadata": {},
     "source": [
      "http://www.ncbi.nlm.nih.gov/projects/SNP/snp_ref.cgi?rs=509749"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import hgvs.dataproviders.uta\n",
      "import hgvs.variantmapper\n",
      "import hgvs.parser"
     ],
     "language": "python",
     "metadata": {
      "slideshow": {
       "slide_type": "slide"
      }
     },
     "outputs": [],
     "prompt_number": 1
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "hdp = hgvs.dataproviders.uta.connect()\n",
      "variantmapper = hgvs.variantmapper.VariantMapper(hdp)\n",
      "hgvsparser = hgvs.parser.Parser()"
     ],
     "language": "python",
     "metadata": {
      "slideshow": {
       "slide_type": "slide"
      }
     },
     "outputs": [],
     "prompt_number": 2
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "var_c1 = hgvsparser.parse_hgvs_variant('NM_001261456.1:c.1762A>G')\n",
      "var_p1 = variantmapper.c_to_p(var_c1, None)\n",
      "var_c1, var_p1"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "metadata": {},
       "output_type": "pyout",
       "prompt_number": 3,
       "text": [
        "(SequenceVariant(ac=NM_001261456.1, type=c, posedit=1762A>G),\n",
        " SequenceVariant(ac=MD5_e999a940ca422ec8cab9bc3cc64e0d7d, type=p, posedit=(Met588Val)))"
       ]
      }
     ],
     "prompt_number": 3
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "var_g = variantmapper.c_to_g(var_c1,'NC_000001.10')\n",
      "var_g"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "metadata": {},
       "output_type": "pyout",
       "prompt_number": 4,
       "text": [
        "SequenceVariant(ac=NC_000001.10, type=g, posedit=160793560A>G)"
       ]
      }
     ],
     "prompt_number": 4
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "txs = hdp.get_tx_for_gene('LY9')\n",
      "txs"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "metadata": {},
       "output_type": "pyout",
       "prompt_number": 5,
       "text": [
        "[['LY9', 30, 1998, 'ENST00000263285', 'NC_000001.10', 'genebuild'],\n",
        " ['LY9', 1, 583, 'ENST00000368039', 'NC_000001.10', 'genebuild'],\n",
        " ['LY9', 0, 1648, 'ENST00000392203', 'NC_000001.10', 'genebuild'],\n",
        " ['LY9', 0, 1833, 'ENST00000368037', 'NC_000001.10', 'genebuild'],\n",
        " ['LY9', 211, 1024, 'ENST00000368035', 'NC_000001.10', 'genebuild'],\n",
        " ['LY9', 50, 1616, 'ENST00000341032', 'NC_000001.10', 'genebuild'],\n",
        " ['LY9', 170, 1751, 'ENST00000368041', 'NC_000001.10', 'genebuild'],\n",
        " ['LY9', 1094, 1907, 'ENST00000368040', 'NC_000001.10', 'genebuild'],\n",
        " ['LY9', 114, 2040, 'NM_001261456.1', 'AC_000133.1', 'splign'],\n",
        " ['LY9', 114, 2040, 'NM_001261456.1', 'NC_000001.10', 'blat'],\n",
        " ['LY9', 114, 2040, 'NM_001261456.1', 'NC_000001.10', 'splign'],\n",
        " ['LY9', 114, 2040, 'NM_001261456.1', 'NC_018912.2', 'splign'],\n",
        " ['LY9', 114, 696, 'NM_001033667.2', 'AC_000133.1', 'splign'],\n",
        " ['LY9', 114, 696, 'NM_001033667.2', 'NC_000001.10', 'blat'],\n",
        " ['LY9', 114, 696, 'NM_001033667.2', 'NC_000001.10', 'splign'],\n",
        " ['LY9', 114, 696, 'NM_001033667.2', 'NC_018912.2', 'splign'],\n",
        " ['LY9', 114, 2082, 'NM_002348.3', 'AC_000133.1', 'splign'],\n",
        " ['LY9', 114, 2082, 'NM_002348.3', 'NC_000001.10', 'blat'],\n",
        " ['LY9', 114, 2082, 'NM_002348.3', 'NC_000001.10', 'splign'],\n",
        " ['LY9', 114, 2082, 'NM_002348.3', 'NC_018912.2', 'splign'],\n",
        " ['LY9', 114, 1812, 'NM_001261457.1', 'AC_000133.1', 'splign'],\n",
        " ['LY9', 114, 1812, 'NM_001261457.1', 'NC_000001.10', 'blat'],\n",
        " ['LY9', 114, 1812, 'NM_001261457.1', 'NC_000001.10', 'splign'],\n",
        " ['LY9', 114, 1812, 'NM_001261457.1', 'NC_018912.2', 'splign']]"
       ]
      }
     ],
     "prompt_number": 5
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "var_c2 = variantmapper.g_to_c(var_g,'NM_001261457.1',alt_aln_method='splign')\n",
      "var_p2 = variantmapper.c_to_p(var_c2, None)\n",
      "var_c2, var_p2"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "metadata": {},
       "output_type": "pyout",
       "prompt_number": 6,
       "text": [
        "(SequenceVariant(ac=NM_001261457.1, type=c, posedit=1534A>G),\n",
        " SequenceVariant(ac=MD5_921ebefe79bff479f4bfa17e133fc084, type=p, posedit=(Met512Val)))"
       ]
      }
     ],
     "prompt_number": 6
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [],
     "language": "python",
     "metadata": {},
     "outputs": [],
     "prompt_number": 6
    }
   ],
   "metadata": {}
  }
 ]
}